<template>
    <div class="Right">
        <div class="nav">最热文档</div>
        <li v-for="h in hotarticle" :key="h.id">
            <div style="margin-bottom:5px;">
                <a class="title" :href="['/#/article/' + h.id]">
                    {{ h.title }}
                </a>
            </div>
            <div class="content">
                {{h.content }}
            </div>
            <div class="foot">
                <div style="display:flex;justify-content:space-between;flex:1;margin:0 10px 0 0; ">
                   <a class="author" :href="['/#/userinfo/' + h.author.id]">{{h.author.username }}</a> 
                   <div class="store">{{ h.store.name }}</div>
                </div>
                <div class="viewcount"> <i class="el-icon-view"></i>&nbsp;{{h.viewcount}}</div>
            </div>
        </li>
    </div>
</template>
<script>
import { gethotarticle } from '../../api/api'
export default {
    name: 'Right',
    data() {
        return {
            hotarticle: [],
        }
    },
    created() {
        gethotarticle().then(res => {
            this.hotarticle = res.data.data;
        })
    }
}
</script>

<style scoped="scoped">
.Right {
    height: 100%;
    min-height: 600px;
    width: 300px;
    box-shadow: 0 5px 10px rgba(212, 212, 212, 0.5);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 0;
}

ul,
li {
    padding: 0;
    margin: 0;
    list-style: none
}

li {
    padding: 20px;
    margin: 0px;
    height: 60px;
}

li:hover {
    background: rgb(226, 240, 253);
}

.nav {
    padding: 10px;
    margin: 10px;
    color: rgb(45, 44, 44);
    border-bottom: 1px solid #e5e6eb;
}

.title{
    color: rgb(28, 118, 235);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}
.author{
    font-size: 13px;
    margin:5px 0;
    color: #565d65;
    text-decoration: none;
}
.store{
    font-size: 13px;
    margin:5px 0;
    color: #565d65;
    text-decoration: none;
}
.content{
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a:hover {
    text-decoration: underline !important;
}
.foot{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.viewcount{
    font-size: 12px;
    margin:5px 0;
    color: #565d65;
}
</style>